package ziv.map.utils;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

import ziv.utils.html.FileAndroid;
import android.util.Log;

public class ConfigControl {

	private static String selfMobile;

	public static void setSelfMobile(String mobile) {
		FileAndroid fileUtil = new FileAndroid();
		// if(fileUtil.isFileExist(Constant.configDir+"/"+Constant.configFileName)){
		//
		//
		// }else{
		fileUtil.writeSDFromString(Constant.configDir, Constant.configFileName,
				mobile);
		// }
	}

	public static String getSelfMobile() throws IOException {
		FileAndroid fileUtil = new FileAndroid();

		File file = fileUtil.readSDFromString(Constant.configDir,
				Constant.configFileName);
		if (file == null) {
			return "";
		} else {
			FileReader fileReader = new FileReader(file);
			BufferedReader br = new BufferedReader(fileReader);
			return br.readLine();
		}

	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
